<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@page import="java.util.List" %>
<%@page import="java.util.Iterator" %>
<%@page import="domain.User" %>
<%@ include file="time.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>显示用户信息</title>
</head>
<body style="text-align:center;">
<%
    Object obj = session.getAttribute("user");
    User user = (User) obj;
    if (null == obj) {
%>
您尚未登陆，请登录！
<a href="login.jsp" name="login">去登录</a>
<a href="register.jsp" name="register">跳转注册</a>
<%
} else {
%>
<div style="text-align:center;">
    当前用户:<%=user.getUsername() %>
    <a href="exit.jsp" name="exit">退出登录</a>
    <a href="login_success.jsp" name="success">返回</a>
</div>
<h1>用户注册信息表</h1>
<table border="1px" align="center">
    <tr>
        <th>用户名</th>
        <th>密码</th>
        <th>邮箱</th>
        <th>单位</th>
        <th>注册时间</th>
    </tr>
    <tr>
        <td><%=user.getUsername()%>
        </td>
        <td><%=user.getPassword()%>
        </td>
        <td><%=user.getEmail()%>
        </td>
        <td><%=user.getUnit()%>
        </td>
        <td><%=user.getRegistertime()%>
        </td>

    </tr>
</table>
<h1>用户补充信息表</h1>
<table border="1px" align="center">
    <tr>
        <th>真名</th>
        <th>电话</th>
        <th>生日</th>
    </tr>
    <tr>
        <td><%=user.getRealname()%>
        </td>
        <td><%=user.getPhone()%>
        </td>
        <td><%=user.getBirth()%>
        </td>
    </tr>
</table>
<br>
<h1><a href="user_info_update.jsp" title="changePwd">修改密码</a></h1>
<%}%>
</body>
</html>